package com.fw.system.admin.service.impl;

import java.util.List;
import com.fw.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.fw.common.IdXD;
import com.fw.system.admin.mapper.TbIntegralLogMapper;
import com.fw.system.admin.domain.TbIntegralLog;
import com.fw.system.admin.service.ITbIntegralLogService;
import com.fw.utils.DateUtils;
/**
 * 积分明细Service业务层处理
 * 
 * @author yanwei
 * @date 2023-04-04
 */
@Service
public class TbIntegralLogServiceImpl extends ServiceImpl<TbIntegralLogMapper, TbIntegralLog> implements ITbIntegralLogService
{
    @Autowired
    private TbIntegralLogMapper tbIntegralLogMapper;

    @Autowired
    private IdXD idXD;

    /**
     * 查询积分明细
     * 
     * @param id 积分明细ID
     * @return 积分明细
     */
    @Override
    public TbIntegralLog selectTbIntegralLogById(String id)
    {
        return tbIntegralLogMapper.selectTbIntegralLogById(id);
    }

    /**
     * 查询积分明细列表
     * 
     * @param tbIntegralLog 积分明细
     * @return 积分明细
     */
    @Override
    public List<TbIntegralLog> selectTbIntegralLogList(TbIntegralLog tbIntegralLog)
    {
        return tbIntegralLogMapper.selectTbIntegralLogList(tbIntegralLog);
    }

    /**
     * 新增积分明细
     * 
     * @param tbIntegralLog 积分明细
     * @return 结果
     */
    @Override
    public int insertTbIntegralLog(TbIntegralLog tbIntegralLog)
    {
        tbIntegralLog.setCreateTime(DateUtils.getNowDate());
        tbIntegralLog.setId(idXD.nextId());
        return tbIntegralLogMapper.insertTbIntegralLog(tbIntegralLog);
    }

    /**
     * 修改积分明细
     * 
     * @param tbIntegralLog 积分明细
     * @return 结果
     */
    @Override
    public int updateTbIntegralLog(TbIntegralLog tbIntegralLog)
    {
        return tbIntegralLogMapper.updateTbIntegralLog(tbIntegralLog);
    }

    /**
     * 批量删除积分明细
     * 
     * @param ids 需要删除的积分明细ID
     * @return 结果
     */
    @Override
    public int deleteTbIntegralLogByIds(String[] ids)
    {
        return tbIntegralLogMapper.deleteTbIntegralLogByIds(ids);
    }

    /**
     * 删除积分明细信息
     * 
     * @param id 积分明细ID
     * @return 结果
     */
    @Override
    public int deleteTbIntegralLogById(String id)
    {
        return tbIntegralLogMapper.deleteTbIntegralLogById(id);
    }
}
